<template>
  <view class="page-container">
    <!-- 主内容区 -->
    <scroll-view class="main-content" scroll-y :show-scrollbar="false" safe-area-inset-bottom>
      <!-- 学习技巧 -->
      <view class="study-tips">
        <view class="section-title">游戏趣记</view>
        <view class="tips-card">
          <view class="tips-img">
            <image src="/static/dcxxl.jpg" mode="aspectFill" class="tips-image"/>
          </view>
          <view class="tips-content">
            <view class="tips-title">单词消消乐</view>
            <view class="tips-desc">通过趣味游戏巩固记忆，提升学习效率</view>
            <view class="tips-more" @click="startGame('dcxxl')">
              开始游戏
              <u-icon name="arrow-right" color="#3e7bfa" size="16"></u-icon>
            </view>
          </view>
        </view>
      </view>

      <view class="study-tips">
        <view class="section-title">游戏趣题</view>
        <view class="tips-card" @click="startGame('msddy')">
          <view class="tips-img">
            <image src="/static/dybq.jpg" mode="aspectFill" class="tips-image"/>
          </view>
          <view class="tips-content">
            <view class="tips-title">迷失的搭配</view>
            <view class="tips-desc">短语填空小游戏玩不停，不知不觉就把短语记扎实～</view>
            <view class="tips-more">
              开始游戏
              <u-icon name="arrow-right" color="#3e7bfa" size="16"></u-icon>
            </view>
          </view>
        </view>
        <view class="tips-card" @click="startGame('cqdjz')">
          <view class="tips-img">
            <image src="/static/cqdjz.jpg" mode="aspectFill" class="tips-image"/>
          </view>
          <view class="tips-content">
            <view class="tips-title">残缺的句子</view>
            <view class="tips-desc">快速拼接句子、纠正语序，轻松提升语法应用和句子组织能力～</view>
            <view class="tips-more">
              开始游戏
              <u-icon name="arrow-right" color="#3e7bfa" size="16"></u-icon>
            </view>
          </view>
        </view>
      </view>

      <view class="study-tips">
        <view class="section-title">能说会写</view>
        <view class="tips-card" @click="startGame">
          <view class="tips-img">
            <image src="/static/dctxxdr.jpg" mode="aspectFill" class="tips-image"/>
          </view>
          <view class="tips-content">
            <view class="tips-title">速记听写小达人</view>
            <view class="tips-desc">快速听写 + 即时反馈，轻松变身单词记忆小能手！</view>
            <view class="tips-more">
              开始游戏
              <u-icon name="arrow-right" color="#3e7bfa" size="16"></u-icon>
            </view>
          </view>
        </view>
      </view>
    </scroll-view>
  </view>
</template>

<script>
export default {
  methods: {
    startGame(type) {
      uni.navigateTo({url: `/pages/game/home?type=${type}`})
    }
  }
}
</script>

<style scoped lang="scss">
.page-container {
  background-color: #f5f7fa;
  min-height: 100vh;
}

.nav-right {
  padding-right: 16rpx;
}

.main-content {
  padding: 24rpx 30rpx 0;
}

/* 标题样式 */
.section-title {
  font-size: 32rpx;
  font-weight: 600;
  color: #303133;
  margin-bottom: 20rpx;
  position: relative;
  padding-left: 16rpx;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8rpx;
  height: 28rpx;
  background-color: #3e7bfa;
  border-radius: 4rpx;
}

/* 学习技巧卡片 */
.study-tips {
  margin-bottom: 36rpx;
}

.tips-card {
  background-color: #fff;
  border-radius: 16rpx;
  display: flex;
  overflow: hidden;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
}

.tips-img {
  width: 200rpx;
  height: 200rpx;
  position: relative;
}

.tips-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tips-content {
  flex: 1;
  padding: 24rpx;
  display: flex;
  flex-direction: column;
}

.tips-title {
  font-size: 28rpx;
  font-weight: 600;
  color: #303133;
  margin-bottom: 12rpx;
}

.tips-desc {
  font-size: 24rpx;
  color: #606266;
  margin-bottom: 16rpx;
  flex: 1;
}

.tips-more {
  font-size: 24rpx;
  color: #3e7bfa;
  display: flex;
  align-items: center;
}

.tips-more .u-icon {
  margin-left: 6rpx;
}
</style>
